package aad.storyboard.view;

import aad.storyboard.controller.NavigationButton;
import aad.storyboard.model.Scene;
import aad.storyboard.model.Story;
import android.content.Context;
import android.util.AttributeSet;

public class BackButton extends NavigationButton{
    
	private int position=0;
	Scene previousScene=null;
	
	public BackButton(Context context) {
		super(context);
		
	}
	
	public BackButton(Context context, AttributeSet attrs)
    {
        super(context, attrs);
        
    			
    }

	@Override
	public void execute() {		
		previousScene=Story.getInstance().getCurrentChapter().getPreviousScene();
		if(previousScene!=null)position=previousScene.getStartTime();
		player.seekToPosition(position);
		System.out.println("prevPosition"+position);
		
	}

	
}
